/*
  Copyright (c) Microsoft. All rights reserved.  
  Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
var fs, path;

module.exports = function(context) {
    // fs = require('fs');
    // path = require('path');

    // var fileDest = path.join(process.cwd(), 'platforms', 'android', 'src', 'com', 'lezhu', 'check', 'MainActivity.java');
    // var fileSrc = path.join(process.cwd(), 'plugins', 'lezhu-plugin-umeng', 'extra', 'MainActivity.java');
    // console.log("copy MainActivity.java to " + fileDest);
    // copyFiles(fileSrc, fileDest);
    // Recusive copy function for res/native processing
    function copyFiles(srcPath, destPath) {
        if (fs.statSync(srcPath).isDirectory()) {
            if (!fs.existsSync(destPath)) {
                fs.mkdirSync(destPath);
            }
            fs.readdirSync(srcPath).forEach(function (child) {
                copyFiles(path.join(srcPath, child), path.join(destPath, child));
            });
        } else {
            fs.writeFileSync(destPath, fs.readFileSync(srcPath));
        }
    }   
};